<admintpl file="header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:U('Admin/User/index')}">{:L('ADMIN_USER_INDEX')}</a></li>
			<li><a href="{:U('Admin/User/add')}">{:L('ADMIN_USER_ADD')}</a></li>
		</ul>
		<form class="well form-search" method="post" action="{:U('Admin/User/index',array('downloads'=>1))}">
			<div class="search_type cc mb10">
				<div class="mb10">
					<span class="mr20">
						<input type="submit" class="btn btn-primary" value="下载" />
					</span>
				</div>
			</div>
		</form>
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th width="50">ID</th>
					<th>渠道类型</th>
					<th>{:L('USERNAME')}</th>
					<th>联系人</th>
					<th>{:L('LAST_LOGIN_IP')}</th>
					<th>{:L('LAST_LOGIN_TIME')}</th>
					<th>{:L('EMAIL')}</th>
					<th>电话</th>
					<th>QQ</th>
					<th>{:L('STATUS')}</th>
					<th width="120">{:L('ACTIONS')}</th>
				</tr>
			</thead>
			<tbody>
				<php>$user_statuses=array("3"=>L('USER_STATUS_BLOCKED'),"2"=>L('USER_STATUS_ACTIVATED'),"1"=>L('USER_STATUS_UNVERIFIED'));</php>
				<foreach name="users" item="vo">
				<tr>
					<td>{$vo.id}</td>
					<td>{$roles[$vo['user_type']]}</td>
					<td>{$vo.user_login}</td>
					<td>{$vo.linkman}</td>
					<td>{$vo.last_login_ip}</td>
					<td>
						<if condition="$vo['last_login_time'] eq 0">
							{:L('USER_HAVENOT_LOGIN')}
						<else />
							{$vo.last_login_time}
						</if>
					</td>
					<td>{$vo.user_email}</td>
					<td>{$vo.mobile}</td>
					<td>{$vo.qq}</td>
					<td>{$user_statuses[$vo['user_status']]}</td>
					<td>
						<if condition="$vo['id'] eq 1">
						<font color="#cccccc">{:L('EDIT')}</font> | <font color="#cccccc">{:L('DELETE')}</font> |
							<if condition="$vo['user_status'] eq 2">
								<font color="#cccccc">{:L('BLOCK_USER')}</font>
							<else />
								<font color="#cccccc">{:L('ACTIVATE_USER')}</font>
							</if>
						<else />
							<a href='{:U("Admin/User/edit",array("id"=>$vo["id"]))}'>{:L('EDIT')}</a> | 
							<a class="js-ajax-delete" href="{:U('Admin/User/delete',array('id'=>$vo['id']))}">{:L('DELETE')}</a> | 
							<if condition="$vo['user_status'] eq 2">
								<a href="{:U('Admin/User/ban',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="{:L('BLOCK_USER_CONFIRM_MESSAGE')}">{:L('BLOCK_USER')}</a>
							<else />
								<a href="{:U('Admin/User/cancelban',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="{:L('ACTIVATE_USER_CONFIRM_MESSAGE')}">{:L('ACTIVATE_USER')}</a>
							</if>
						</if>
					</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
</body>
</html>